
<div id ="paper-list">
  <h1> Papers listing</h1>
<div  id="paper-search">
      <%= form_tag({:action => 'search'}, :multipart => true) %>  
      Search Paper:<%= text_field_tag("query")%>
      <%= submit_tag("Search") %>  
      <%= end_form_tag %>  
</div>


  <table cellpadding="5" cellspacing="0" width="80%">  
  <% for paper in @papers %>
  <tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>">
    <td  >
     <span class="list-title"> <%=h paper.title %></span><br />
     Author:<%=h paper.author %><br/>
     Publisher:<%=h paper.publisher %></br>
     ISBN:<%=h paper.ISBN %></br>
     PageInfo:<%=h paper.page_info %></br>
      </td>
      <td width="60%">
        Abstraction</br>
        <%= h(truncate(paper.abstract, 80)) %>
      </td>
      <td class="list-action">
        <%= link_to 'Detail', :action => 'show', :id => paper %>
        <%if session[:administrator_id]%>
        <%= link_to 'Edit', :action => 'edit', :id => paper %>
        <%= link_to 'Delete', { :action  => 'delete', :id => paper },
                                         :confirm => "Are you sure?",
                                         :method  => :post %>
        <% end%>  
      </td>
  
  <% end %>
  </table>
</div>

<%= link_to 'Previous page', { :page => @paper_pages.current.previous } if @paper_pages.current.previous %>
<%= link_to 'Next page', { :page => @paper_pages.current.next } if @paper_pages.current.next %> 

